<?php

declare(strict_types=1);

namespace app\common\model\auth;

use Dengje\Pxy\BaseModel;

class AdminModel extends BaseModel
{
    protected $name = 'admin';

    protected $type = [
        'login_time'  =>  'timestamp',
    ];

    protected $append = ['role_ids'];

    protected $json = [];    // 自动 json 转换

    // public function getAvatarAttr($value)
    // {
    //     return FileService::getFileUrl($value);
        
    // }
    
    // public function getRoleIdsAttr()
    // {
    //     return AdminRoleModel::where('admin_id',$this->id)->column('role_id');
    // }

    // public function getDeptIdsAttr()
    // {
    //     return AdminDeptModel::where('admin_id',$this->id)->column('dept_id');
    // }
    

    // public function role()
    // {
    //     return $this->hasOne(RoleModel::class, "id", "role_id")->field("id, name");
    // }
}
